From: Glenn Morris Date: Wed, 18 Feb 2009 04:35:02 +0000 (+0000) Subject: (mail-mbox-from): Move here from rmailout.el. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~1723 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=6eb5b184728e814f02ff708834fdd6f3cace22bc;p=emacs.git (mail-mbox-from): Move here from rmailout.el. --- diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index 9c607cb4f4c..e988cba7073 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -386,6 +386,20 @@ matches may be returned from the message body." (substring s (match-beginning 3) (match-end 3)) " " (mail-rfc822-time-zone time)))) +(defun mail-mbox-from () + "Return an mbox \"From \" line for the current message. +The buffer should be narrowed to just the header." + (let ((from (or (mail-fetch-field "from") + (mail-fetch-field "really-from") + (mail-fetch-field "sender") + "unknown")) + (date (mail-fetch-field "date"))) + (format "From %s %s\n" (mail-strip-quoted-names from) + (or (and date + (ignore-errors + (current-time-string (date-to-time date)))) + (current-time-string))))) + (provide 'mail-utils) ;; arch-tag: b24aec2f-fd65-4ceb-9e39-3cc2827036fd